/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"24864838-49FB-424D-9FB9-84F2F5552D2D"}
 */
var fError = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"659984C3-618F-4C9D-9506-2555B2122A5C"}
 */
var fUser = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"3D606C0A-C3DB-43D2-8CA5-C620711B5A19"}
 */
var fPass = null;

/**
 *
 * @properties={typeid:24,uuid:"7F71F398-A2F8-4104-A45F-5901B835E221"}
 * @AllowToRunInFind
 */
function Entrar()
{
	var ok = security.authenticate("mod_login_auth","autenticar",['fwk_navigation_infocom',fUser,fPass]) 
	if (ok == 1)
	{
		return true
	}
	else
	{
		switch (ok)
		{
			case 2:
			{
				//globals.DIALOGS.showErrorDialog('Error','Usuario incorrecto o permiso denegado','OK')
				fError = '*Permiso denegado'
				break;
			}
			case 3:
			{
				//globals.DIALOGS.showErrorDialog('Error','*Contraseña incorrecta','OK')
				fError = '*Contraseña incorrecta'
				break;
			}
			case 4:
			{
				//globals.DIALOGS.showErrorDialog('Error','Usuario no existe','OK')
				fError = '*Usuario no existe'
				break;
			}
		}
	return false
	}
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"0F9FA402-2CAE-4152-89F8-9C78FCDF9C72"}
 */
function onShow(firstShow, event) {
	elements.lbl_solucion.text = globals.gSolucionTexto//application.getSolutionName().toUpperCase()
	elements.gLoginUserv.requestFocus()
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"0F366F23-5311-45E8-8129-9FFE0553D7A0"}
 */
function onHide(event) {
	if (security.getUserName() == null)
		return false
		
	return true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"F13B08EE-DAFE-4704-9001-210876A0D742"}
 */
function salir(event) {
	application.exit()
}
